Unplugging Components using Aspects
نویسندگان
چکیده
Normally, Aspect-Oriented Programming (AOP) is used for plugging and not for unplugging. Aspects (concerns) are weaved into a system, thus providing a modularized way to add crosscutting features to a base program. For example, given a base program without logging and given a logging aspect, the AOP weaver produces from the untangled code an executable with the desired crosscutting logging behaviors. The benefit is that the logging code is modularized, e.g., you can easily activate or deactivate logging. However, what if a legacy system written without AOP technology already contains logging functionality hard-coded in the base program? How do you deactivate logging then? In this paper, we explore the use of AOP for writing aspects that transform exiting hard-coded calls into plugs that can be used to retarget the client to use other subcomponents. Applying AOP for unplugging has potential usage in connection with components. You are given a monolithic system. You apply AOP to non-intrusively decouple the system’s components. You may then replace some of the legacy components with alternative third-party components. 1. AOP FOR UNPLUGGING Consider a client that is strongly coupled with a component , for which third-party alternatives, , exist. Presumably, present a spectrum of trade-offs for the client to choose from, e.g., on certain methods, or may be more efficient than . Suppose that the client calls methods , , and directly on , and that and were developed independently by third-parties and provided without their source code [13]. AOP [4] can help to selectively unplug the client from certain calls to , and plug those calls back into or (Figure 1). Normally, one would need to change the code of the client or the code of the components. Changing the client code is intrusive and the result is not retargetable. Changing the component is also undesired, because it will affect other clients too. Moreover, it may be impossible to change a third-party component. Instead one can employ AOP to achieve pluggability. We first motivate this approach using the standard logging example in AspectJ [6, 3]. In Section 2 we illustrate this approach for the complex case of retargeting a client of reflection in Java [1]. 1.1 Logging Unplugged The components of the system may already be coupled and their code tangled. Consider a legacy system where the client code (class Supported in part by the National Science Foundation (NSF) under Grants No. CCR-0098643 and CCR-0204432, and by the Institute for Complex Scientific Software at Northeastern University. Legacy code Third-party Component Retarget Aspect call call
منابع مشابه
Unplugged: Exploring the costs and benefits of constant connection
Computer-mediated-communication (CMC) is a ubiquitous part of people’s lives, yet little research has investigated attitudes about unplugging, also known as media refusal. In this large-scale lifespan study we surveyed 446 participants ages 14e79 about their feelings and attitudes toward unplugging from CMC for 24 h. We also probed their actual recent experiences of unplugging. We were particul...
متن کاملDesign Optimization of Innovative High - Level Waste Pipeline Unplugging Technologies – 13341
Florida International University (FIU) is currently working on the development and optimization of two innovative pipeline unplugging methods: the asynchronous pulsing system (APS) and the peristaltic crawler system (PCS). Experiments were conducted on the APS to determine how air in the pipeline influences the system’s performance as well as determine the effectiveness of air mitigation techni...
متن کاملDigital Simplicity: Usable Personal Ubicomp
There are many indicators to suggest that Americans feel technology is complicating their lives. These range from the growing strength of the voluntary simplicity movement [Elgin 1998] and the slew of popular books on “unplugging” [Brende 2004] to research showing that many consumers are overwhelmed by the increasing complexity of daily living [Breen-Pierce & Robin 2000]. In response, many indi...
متن کاملNon-Invasive Gridi cation through an Aspect-Oriented Approach
This paper presents a framework that allows plugging or unplugging Grid-related features to legacy code. Those features can, for example, transform sequential-like code to a parallel version or even a distributed version. With this approach scientists could develop their code as they are used to, that is, they could spent their time programming as they are used to instead of learning new progra...
متن کاملUnplugging the Leadership Quagmire: the Case for Developing Nations
he interpretation and cultural nuances behind the concept of leadership are not only questionable but are subject to different meanings to different people. Yet, within the organisational context, there are specific boundaries that must be adhered to in order to inculcate certain values. Leadership at a political level is not excluded from democratically instated norms. The failure to maintain ...
متن کامل